package com.zwl.smartplatform.mapper;

import com.zwl.smartplatform.pojo.Scene;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;

public interface SceneMapper {

    @Insert("insert into sys_scene (scene_name,create_by,create_time) values (#{sceneName},#{createBy},@{createTime})" )
    void addScene(Scene scene);

    @Update("update sys_scene set status=1 , create_time = #{date} where scene_id=#{sid}")
    void reEnableScene(@Param("sid") Long sid,@Param("date") Date date);

    @Select("select * from sys_scene where create_by=#{uid} and scene_name=#{sceneName}")
    Scene selectByUserIdAndName(@Param("uid") Long uid,@Param("sceneName") String sceneName);
}
